<template>
	<view class="tou">
		<view class="marge">
			<uv-icon name="arrow-left" bold="true" labelColor="#000000" size="22px" @click="back"></uv-icon>
			<div>问诊列表</div>
			<div>
				<image src="../../static/common_nav_message_black_n.png" mode="" class="ling" @click="ld">
				</image>
			</div>
		</view>
		<view v-for="(item,index) in list" :key="index">
			<view class="list" @click="gotopeck">
				<uni-swipe-action>
					<uni-swipe-action-item :right-options="options" @click="onClick(item.id)" @change="change">
						<div>
							<uni-list-chat :avatar-circle="true" :title="item.username"
								avatar="https://img2.woyaogexing.com/2024/08/17/7a202913497e6b7ca55f635d90e966a3.png"
								:note="item.context" time="2019-03-02">
							</uni-list-chat>
						</div>



					</uni-swipe-action-item>
				</uni-swipe-action>

			</view>

		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				options: [{
						text: '结束问诊',
						style: {
							backgroundColor: '#ff5500'
						}
					}

				],
				list: [],
			}


		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList() {
				uni.request({
					url: "http://172.27.6.151:32112/api/get/patientList"
				}).then(res => {
					console.log("列表数据", res.data.data);
					this.list = res.data.data
				})
			},
			onClick(e) {
				console.log('点击了', e);
				this.list = this.list.filter(item => item.id !== e);
			},
			back() {
				uni.reLaunch({
					url: '/pages/Index/Index'
				})
			},
			ld() {
				uni.navigateTo({
					url: '/pages/Information/Information'
				})
			},
			gotopeck() {
				console.log(111);
				uni.navigateTo({
					url: "/pages/ChatPage/ChatPage"
				})
			}
		}
	}
</script>

<style>
	.marge {
		display: flex;
		justify-content: space-between;
		margin-top: 100rpx;

	}

	.list {
		height: 150rpx;

	}

	.ling {
		width: 60rpx;
		height: 60rpx;
	}

	.ling image {
		width: 100%;
		height: 100%;

		position: fixed;
		top: 500rpx;
		right: 300rpx;
	}
</style>